<%-- 
    Document   : Catelory
    Created on : Sep 3, 2014, 10:58:16 AM
    Author     : thanhap
--%>

<%@page import="java.util.List"%>
<%@page import="bo2s.data.Article"%>
<%@page import="bo2s.DAO.PostDAO"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertTemplate template="/template_admin/TempalteAdmin.jsp">

        <tiles:putAttribute name="titleAdmin">
           Catelory
	</tiles:putAttribute>
    
	<tiles:putAttribute name="contentadmin">
            <div class="container-fluid">
            <div class="row">
                <h2 class="bg-primary" ALIGN="CENTER">Catelory</h2>
                 <table class="table">
                <thead>
		<tr>
			<td>Id Article</td>
			<td>Name Article</td>
			<td>Discription</td>
			<td>content</td>
			<td>published</td>
			<td>created</td>
			<td>category_id</td>
			<td>user_id</td>
			
		</tr>
                </thead>
                <tbody>
                 <%
                        PostDAO eb = new PostDAO();
                        List<Article> list = eb.getListArticle();
                        for (Article e : list) {
                %>
		<tr>
			<td><%=String.valueOf(e.getId())%></td>
			<td><%=e.getName()%></td>
			<td><%=e.getDescription()%></td>
			<td><%=e.getContent()%></td>
			<td><%=String.valueOf(e.getPublished())%></td>
			<td><%=e.getCreated()%></td>
			<td><%=String.valueOf(e.getCategory_id())%></td>
			<td><%=String.valueOf(e.getUser_id())%></td>
		</tr>
                <%
                  }
                 %>
                </tbody>
            </table>       
            </div>
            </div>
	</tiles:putAttribute> 	
           
           
</tiles:insertTemplate>
